// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import Client from '@api/order/api/AppWorkOrderApi'

import OneClass from '@api/order/model/AppQueryWorkOrderDetailReq'
import API from '@admin/components/detail/DetailRepair/store/API'

const CLIENT = CORE.grpcCLIENT(Client)

// ============================== 导出远程接口 ============================== //

export default {
  // —————————————————————————————— 单项 —————————————————————————————— //

  validOne: API.validOne,
  async getOne({ id }, TIP = '查询工单详情') {
    const DTO = CORE.grpcDTO(OneClass, { id })
    const resp = await CORE.grpc(TIP, CLIENT, 'queryAppWorkOrderDetail', DTO)
    return resp.workOrderDto || {}
  },
  transOne: API.transOne,
}
